//@author A0101712B
#ifndef UI_H
#define UI_H
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include "Task.h"

static const int ZERO = 0;

static const char CHAR_ENDLINE = '\n';

static const int SHORTSTRING_BOUNDARY = 1;

static const int COLOR_YELLOW = 14;
static const int COLOR_DARK_YELLOW = 6;
static const int COLOR_WHITE = 15;
static const int COLOR_DARK_CYAN = 3;
static const int COLOR_RED_ON_BLUE = 28;
static const int COLOR_YELLOW_ON_BLUE = 30;
static const int COLOR_WHITE_ON_BLUE = 31;

static const int UI_DEFAULT_HEIGHT = 600;
static const int UI_DEFAULT_WIDTH = 800;

static const int DEFAULT_TABLE_WIDTH = 79;
static const int DEFAULT_ID_WIDTH = 5;
static const int DEFAULT_TIME_WIDTH = 38;
static const int DEFAULT_DESC_WIDTH = DEFAULT_TABLE_WIDTH - DEFAULT_ID_WIDTH - DEFAULT_TIME_WIDTH - 1;
static const int SHRUNK_DESC_WIDTH = DEFAULT_DESC_WIDTH - 4;

static const int DEFAULT_TIME_WIDTH_DEADLINE = 21;
static const int DEFAULT_DESC_WIDTH_DEADLINE = DEFAULT_TABLE_WIDTH - DEFAULT_ID_WIDTH - DEFAULT_TIME_WIDTH_DEADLINE - 1;
static const int SHRUNK_DESC_WIDTH_DEADLINE = DEFAULT_DESC_WIDTH_DEADLINE - 4;

static const int DEFAULT_TICK_WIDTH_NORMAL = 5;
static const int DEFAULT_DESC_WIDTH_NORMAL = DEFAULT_TABLE_WIDTH - DEFAULT_ID_WIDTH - DEFAULT_TICK_WIDTH_NORMAL - 1;
static const int SHRUNK_DESC_WIDTH_NORMAL = DEFAULT_DESC_WIDTH_NORMAL - 4;

static const std::string UI_TABLE_LINE = "===============================================================================";
static const std::string UI_TABLE_SEPARATOR = "-------------------------------------------------------------------------------";
static const std::string UI_PROMPT_USER = "Please enter your command: ";
static const std::string UI_WELCOME_MESSAGE = "Welcome to Twentyfifth!";
static const std::string UI_ID = "ID";
static const std::string UI_TIME = "Time";
static const std::string UI_DEADLINE = "Deadline";
static const std::string UI_COMPLETED = "Done?";
static const std::string UI_DESCRIPTION = "Description";
static const std::string UI_DEADLINE_PREFIX = "by ";
static const std::string UI_SINGLE_SPACE = " ";
static const std::string UI_TOBE_CONTINUED = "...";
static const std::string UI_TIME_SEPARATOR = " - ";
static const std::string UI_NOTICE1 = "To scroll up and down, Please press Alt+Space together, and then E, then L";
static const std::string UI_NOTICE2 = "To get out of the scroll mode, press Esc or Enter";
static const std::string UI_DONE = "[x]";
static const std::string UI_NOTDONE = "[ ]";
static const std::string UI_CLEAR = "CLS";

static const std::string UI_MSG_ERR_NO_TIMED_TASK = "No timed tasks.";
static const std::string UI_MSG_ERR_NO_DEADLINE_TASK = "No deadline tasks.";
static const std::string UI_MSG_ERR_NO_NORMAL_TASK = "No normal tasks.";

namespace Twentyfifth {
	class TwentyfifthUI {
	public:
		void printWelcomeMessage();
		void printUserPrompt();
		void printLongMessage(std::string);
		void printMessage(std::string);
		void printVectorMessage(std::vector<Task>);
		void nextLine();
		std::vector<Task> getTimedTasks(std::vector<Task>);
		std::vector<Task> getDeadlineTasks(std::vector<Task>);
		std::vector<Task> getNormalTasks(std::vector<Task>);
		static bool compareTimedTask(Task, Task);
		static bool compareDeadlineTask(Task, Task);
		static bool compareNormalTask(Task, Task);
		void printCenteredMessage(std::string);
	};
}
#endif